//首页的所有后台请求接口
import {
	request
} from '@/utils/request.js';

const API_PREFIX = "/goods";

//获取首页商品轮播图
export function findIndexImage() {
	return request({
		url: `${API_PREFIX}/index/image`,
		method: 'GET'
	})
}

//获取热卖商品数据
export function findIndexHotGoods() {
	return request({
		url: `${API_PREFIX}/index/hot`,
		method: 'GET'
	})
}

//获取猜你喜欢商品数据
export function findRecommendGoods() {
	return request({
		url: `${API_PREFIX}/index/recommend`,
		method: 'GET'
	})
}

//获取关键字搜索到的商品ids
export function search(param) {
	return request({
		url: `${API_PREFIX}/search/${param}`,
		method: 'GET'
	})
}

//获取关键字搜索到的商品
export function searchGoods(ids,keyword) {
	return request({
		url: `${API_PREFIX}/search/${ids}/${keyword}`,
		method: 'GET'
	})
}

//获取商品详情数据
export function findGoodsDetail(id) {
	return request({
		url: `${API_PREFIX}/detail/${id}`,
		method: 'GET'
	})
}